home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_087 / elib / t.c < prev   
C/C++ Source or Header  |  1992-05-06  |  829b  |  45 lines

  1. /* t.c -- elib test caller    */
  2.  
  3. #include <exec/types.h>
  4. #include <stdio.h>
  5. #include <functions.h>
  6.  
  7. #define RTC printf("return to continue - ");fflush(stdout);getchar()
  8.  
  9. APTR    libbase;
  10. /* this name of this variable is important,
  11.  * since interface routines need to access
  12.  * its contents.
  13.  */
  14.  
  15. /* life is simple if library routines return LONG integers */
  16. LONG    GetDown();
  17. LONG    Double();
  18.  
  19. #define DOUBARG    19
  20.  
  21. main()
  22. {
  23.     LONG    retval;
  24.  
  25.     printf("here we go\n");
  26.     libbase = (APTR) OpenLibrary("mylib.library", 0L);
  27.     printf("openlib returns base: %lx\n", libbase);
  28.  
  29.     RTC;
  30.  
  31.     if (libbase)
  32.     {
  33.         /* test function GetDown()    */
  34.         retval = GetDown();
  35.         printf("called getdown, %ld returned\n", retval);
  36.         RTC;
  37.  
  38.         /* test function Double()    */
  39.         printf("double of %d = %ld\n", DOUBARG, Double((LONG)DOUBARG));
  40.         RTC;
  41.  
  42.         CloseLibrary(libbase);
  43.     }
  44. }
  45.